package com.zzyl.nursing.mapper;

import java.time.LocalDateTime;
import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.zzyl.nursing.domain.FamilyMember;
import com.zzyl.nursing.domain.FamilyMemberElder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.nursing.dto.QueryDeviceDataDto;
import com.zzyl.nursing.vo.FamilyMemberVo;
import com.zzyl.nursing.vo.ListByPageVo;
import com.zzyl.nursing.vo.QueryDeviceDataVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 客户老人家属中间Mapper接口
 * 
 * @author ruoyi
 * @date 2025-01-10
 */
@Mapper
public interface FamilyMemberElderMapper extends BaseMapper<FamilyMemberElder>
{
    /**
     * 查询客户老人家属中间
     * 
     * @param id 客户老人家属中间主键
     * @return 客户老人家属中间
     */
    public FamilyMemberElder selectFamilyMemberElderById(Long id);

    /**
     * 查询客户老人家属中间列表
     * 
     * @param familyMemberElder 客户老人家属中间
     * @return 客户老人家属中间集合
     */
    public List<FamilyMemberElder> selectFamilyMemberElderList(FamilyMemberElder familyMemberElder);

    /**
     * 新增客户老人家属中间
     * 
     * @param familyMemberElder 客户老人家属中间
     * @return 结果
     */
    public int insertFamilyMemberElder(FamilyMemberElder familyMemberElder);

    IPage<ListByPageVo> selectPageByUserId(IPage<ListByPageVo> page, @Param("userId") Long userId);


    /**
     * 修改客户老人家属中间
     * 
     * @param familyMemberElder 客户老人家属中间
     * @return 结果
     */
    public int updateFamilyMemberElder(FamilyMemberElder familyMemberElder);

    /**
     * 删除客户老人家属中间
     * 
     * @param id 客户老人家属中间主键
     * @return 结果
     */
    public int deleteFamilyMemberElderById(Long id);

    /**
     * 批量删除客户老人家属中间
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFamilyMemberElderByIds(Long[] ids);

    List<FamilyMemberVo> selectrByFamilyMemberId(Long userId);

    List<QueryDeviceDataVo> queryDeviceDataListByDay(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("iotId") String iotId, @Param("functionId") String functionId);

    List<QueryDeviceDataVo> queryDeviceDataListByWeek(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("iotId") String iotId, @Param("functionId") String functionId);

}
